package com.ant.backstage.facade.request.registerLogin;

import com.ant.backstage.utils.validation.inter.CheckPhone;
import com.ant.backstage.utils.validation.inter.CheckPwd;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @Author zhangyu
 * @Description   登录注册请求入参
 * @Date 16:16 2021/12/27
 * @Param
 * @return
 **/
@Data
@Accessors(chain = true)
@Validated
public class UserRegisterRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "账户名不能为空")
    private String uname;
    @Range(max = 150, min = 1, message = "年龄范围应在1-150内")
    private Integer age;
    @CheckPhone
    private String uphone;

    @CheckPwd
    private String newPwd;
    @CheckPwd
    private String confirmPwd;

    private String address;
    private String placeNow;
    private String company;
    private String position;
    private String gender;
    private String mail;
    private String motto;
    private String avattarImg;
    private String idCardNoImg;
    /**
     * 证件号
     */
    @Pattern(regexp = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)")
    private String idCardNo;
    /**
     * 证件是否长期有效  true/false
     */
    @Pattern(regexp = "^true|false$")
    private String validStart;



}
